export const postData = (options) => {
	return new Promise((resolve, reject) => {
		uni.request({
			url: options.url,
			method: 'POST',
			data: options.data,
			header: {
				'Authorization': uni.getStorageSync('token') || ''
			},
			success: (res) => {
				// console.log('res===post', res)
				if (res.statusCode == 200) {
					resolve(res.data)
				} else {
					resolve(false)
				}
			},
			fail: (err) => {
				console.log('fail===', options,err)
				reject(err)
			}
		})
	})
}
export const getData = (options) => {
	return new Promise((resolve, reject) => {
		uni.request({
			url: options.url,
			method: 'GET',
			header: {
				'Authorization': uni.getStorageSync('token') || ''
			},
			success: (res) => {
				// console.log('res===get', res)
				if (res.statusCode == 200) {
					resolve(res.data)
				} else {
					resolve(false)
				}
			},
			fail: (err) => {
				// console.log('err==get', err)
				reject(err)
			}
		})
	})
}
